Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/lm multi qubit op #511

Merged
merged 15 commits into from
Oct 11, 2023
Merged

Bugfix/lm multi qubit op #511

merged 15 commits into from
Oct 11, 2023

Conversation

vincentmr
Copy link
Contributor

@vincentmr vincentmr commented Oct 5, 2023

Before submitting

Please complete the following checklist when submitting a PR:

  • All new features must include a unit test.
    If you've fixed a bug or added code that should be tested, add a test to the
    tests directory!

  • All new functions and code must be clearly commented and documented.
    If you do make documentation changes, make sure that the docs build and
    render correctly by running make docs.

  • Ensure that the test suite passes, by running make test.

  • Add a new entry to the .github/CHANGELOG.md file, summarizing the
    change, and including a link back to the PR.

  • Ensure that code is properly formatted by running make format.

When all the above are checked, delete everything above the dashed
line and fill in the pull request template.


Context:
The LM::multiQubitOp kernel uses bitswap to generate the SV indices on the fly. This does not work when the target wires are such that the corresponding bit positions overlap after swap (i.e. when there are a bunch of them with high target indices).

Description of the Change:
Add failing multi-qubit gate tests. Introduce a generic revWireParity function and fix LM::multiQubitOp.

The corresponding L-Kokkos functors are also broken (gates and expvals). Add failing multi-qubit expval tests and fix gate and expval functors.

Benefits:

Possible Drawbacks:

Related GitHub Issues:

@codecov
Copy link

codecov bot commented Oct 10, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (d0bf669) 98.98% compared to head (b1978a6) 99.13%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #511      +/-   ##
==========================================
+ Coverage   98.98%   99.13%   +0.14%     
==========================================
  Files         142      143       +1     
  Lines       17124    16850     -274     
==========================================
- Hits        16950    16704     -246     
+ Misses        174      146      -28     
Files Coverage Δ
pennylane_lightning/core/_version.py 100.00% <100.00%> (ø)
...ators/lightning_kokkos/gates/GateFunctorsParam.hpp 99.79% <100.00%> (+<0.01%) ⬆️
...s/lightning_kokkos/measurements/ExpValFunctors.hpp 100.00% <100.00%> (ø)
...imulators/lightning_kokkos/utils/BitUtilKokkos.hpp 100.00% <100.00%> (ø)
.../lightning_qubit/gates/AssignKernelMap_Default.cpp 100.00% <ø> (ø)
..._qubit/gates/cpu_kernels/GateImplementationsLM.hpp 100.00% <100.00%> (ø)
...ors/lightning_qubit/gates/tests/Test_KernelMap.cpp 100.00% <ø> (ø)
pennylane_lightning/core/src/utils/BitUtil.hpp 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vincentmr
Copy link
Contributor Author

[SC-47085]

@vincentmr vincentmr marked this pull request as ready for review October 10, 2023 19:08
@vincentmr vincentmr requested a review from a team October 10, 2023 19:08
Copy link
Contributor

@AmintorDusko AmintorDusko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few suggestions.

Copy link
Member

@mlxd mlxd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @vincentmr
No major concerns from me. Feel free to ignore comments if they are irrelevant.

Copy link
Contributor

@AmintorDusko AmintorDusko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Let me know if there is any change here.

@vincentmr vincentmr merged commit 5cb3a67 into master Oct 11, 2023
62 checks passed
@vincentmr vincentmr deleted the bugfix/LM_multiQubitOp branch October 11, 2023 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants